<script lang="ts" setup>
defineOptions({
  name: 'MenuNode',
})
defineProps(['label', 'nodeType'])
</script>

<template>
  <div class="node">
    <div class="icon" :node-type="nodeType">
      <slot name="prefix" />
    </div>
    <span class="label">{{ label }}</span>
  </div>
</template>

<style scoped>
.node {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #fff;
  transition: all 100ms ease-out;
}
.menu-item .node {
  border-bottom: 1px solid #c2c8d5;
}
.node:hover {
  background: rgba(194, 194, 194, 0.15);
  border-left: 4px solid #5F95FF;
  cursor: move;
}
.node:active {
  border-left: 5px solid #5F95FF;
}
.node .icon {
  /* width: 20px;
  height: 20px;
  flex-shrink: 0; */
  margin-left: 8px;
  /* line-height: 1.7; */
}
.node .label {
  display: inline-block;
  flex-shrink: 0;
  width: 104px;
  margin-left: 8px;
  color: #666;
  font-size: 13px;
}
.node .status {
  flex-shrink: 0;
}
.node.success {
  border-left: 4px solid #52c41a;
}
.node.failed {
  border-left: 4px solid #ff4d4f;
}
.node .icon.success {
   color:#52c41a;
}
.node .icon.failed {
  color:#ff4d4f;
}
.x6-node-selected .node.success {
  border-color: #52c41a;
  border-radius: 2px;
  box-shadow: 0 0 0 4px #ccecc0;
}
.x6-node-selected .node.failed {
  border-color: #ff4d4f;
  border-radius: 2px;
  box-shadow: 0 0 0 4px #fedcdc;
}
[data-theme='dark'] .node {
  color: #ffffff;
  border-bottom: 1px solid #808080;
  background-color: #383838;
}
/* [data-theme='dark'] .icon {
  color: #ffffff;
} */
[data-theme='dark'] .label {
  color: #ffffff
}
</style>
